<?php

use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;

class Userinfos extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
        $table = $this->table('userinfos', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '' ,'id' => 'id' ,'primary_key' => ['id']]);
        $table->addColumn('name', 'string', ['limit' => 20,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('sex', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '',])
			->addColumn('shengri', 'string', ['limit' => 20,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('shuxiang', 'string', ['limit' => 4,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('shengao', 'string', ['limit' => 10,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('tizhong', 'string', ['limit' => 20,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('xueli', 'string', ['limit' => 10,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('minzu', 'string', ['limit' => 3,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('che', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '',])
			->addColumn('chedai', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '',])
			->addColumn('fang', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '',])
			->addColumn('fangdai', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '',])
			->addColumn('shouru', 'string', ['limit' => 10,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('fumu', 'string', ['limit' => 100,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('jiemei', 'string', ['limit' => 100,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('yaoqiu', 'string', ['limit' => 200,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('laoshi', 'string', ['limit' => 10,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('vip', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '',])
			->addColumn('lianxi', 'string', ['limit' => 20,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('image', 'string', ['limit' => 100,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('viptime', 'string', ['limit' => 22,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('bak', 'string', ['limit' => 222,'null' => false,'default' => '','signed' => true,'comment' => '',])
			->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
			->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
			->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除字段',])
			->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
            ->create();
    }
}
